<?php

require_once dirname(__FILE__).'/../lib/planificacionGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/planificacionGeneratorHelper.class.php';

/**
 * planificacion actions.
 *
 * @package    sistema_estadisticas
 * @subpackage planificacion
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class planificacionActions extends autoPlanificacionActions
{
	
	public function executeAgregaCarga(sfWebRequest $request)
	{
		if ($request->isXmlHttpRequest())
		{
			$index = $request->getParameter('index');
			$form = new PlanificacionForm();
			
			return $this->renderPartial('carga_horaria_fields', array('cargaForm' => $form->embedCargaForm($index)));
		}
		else
			$this->forward404('Acceso incorrecto');
	}
	
	public function executeEdit(sfWebRequest $request)
	{
		$this->planificacion = PlanificacionTable::getInstance()->fetchOne($request->getParameter('id'));
		$this->form = new PlanificacionForm($this->planificacion);
	}
}
